/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package cn.ekuma.epos.businesslogic;

import com.openbravo.bean.Receipt;
import com.openbravo.bean.erp.Order;
import com.openbravo.bean.sales.Ticket;
import java.util.Date;

/**
 *
 * @author Administrator
 */
public class ReceiptUtil {
      public static Receipt buildReceiptByTicket(Ticket t){
          Receipt obj=new Receipt();
          obj.setId(t.getId());
          obj.setDateNew(new Date());
          obj.setMomey(t.getActiveCash());
          obj.setAttributes(t.getProperties());
          return obj;
      }

     public static Receipt buildReceiptByOrder(Order o){
          Receipt obj=new Receipt();
          obj.setId(o.getId());
          obj.setDateNew(new Date());
          obj.setMomey(o.getActiveCash());
          obj.setAttributes(o.getProperties());
          return obj;
      }
}
